﻿<%@ Page Language="C#" MasterPageFile="~/Masterpages/Default.master" AutoEventWireup="true" CodeBehind="ManageFeedback.aspx.cs" Inherits="Blazing.UI.Cms.Admin.ManageFeedback" Title="Manage Site Feedback" %>
<%@ Register Src="../Usercontrols/ChooseSite.ascx" TagName="ChooseSite" TagPrefix="uc1" %>
<%@ Register Src="../Usercontrols/Loading.ascx" TagName="Loading" TagPrefix="uc3" %>


<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<h1>Manage Feedback</h1>
<uc1:ChooseSite ID="ChooseSite1" runat="server" />
    <hr />
     <ajax:UpdatePanel ID="UpdatePanel1" runat="server">
        <contenttemplate>
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
        AutoGenerateColumns="False" DataKeyNames="ID,UserEmail,UserUrl,RowState" 
        DataSourceID="odsFeedback" 
        EmptyDataText="There is no feedback found on this site" Width="100%">
    <Columns>
        <asp:TemplateField HeaderText="UserName" SortExpression="UserName">
            <ItemTemplate>
                <asp:Label ID="Label1" runat="server" Text='<%# Bind("UserName") %>'></asp:Label> | 
                <a href='mailto:<%# Eval("UserEmail") %>'>[e]</a> 
                <a href='<%# Eval("UserUrl") %>'>[h]</a> 
            </ItemTemplate>
            <EditItemTemplate>
                <asp:Label ID="Label1" runat="server" Text='<%# Bind("UserName") %>'></asp:Label>
            </EditItemTemplate>
        </asp:TemplateField>
        <asp:BoundField DataField="UserRating" HeaderText="UserRating" 
            SortExpression="UserRating" />
        <asp:BoundField DataField="Name" HeaderText="Title" SortExpression="Name" />
        <asp:TemplateField HeaderText="Content" SortExpression="Content">
            <ItemTemplate>
                <asp:Label ID="Label3" runat="server" Text='<%# Bind("Content") %>'></asp:Label>
            </ItemTemplate>
            <EditItemTemplate>
                <asp:TextBox ID="TextBox2" TextMode="MultiLine" Rows="4" Columns="50" runat="server" Text='<%# Bind("Content") %>'></asp:TextBox>
            </EditItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="CreatedDate" SortExpression="CreatedDate">
            <ItemTemplate>
                <asp:Label ID="Label2" runat="server" Text='<%# Bind("CreatedDate") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:CheckBoxField DataField="IsApproved" HeaderText="IsApproved" 
            SortExpression="IsApproved" />
        <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
    </Columns>
    </asp:GridView>
 </contenttemplate>
    </ajax:UpdatePanel>
    <br />
    <br />

    <asp:ObjectDataSource ID="odsFeedback" runat="server" 
        DataObjectTypeName="Blazing.BusinessObjects.Cms.FeedbackItem" 
        DeleteMethod="DeleteFeedbackItem" OldValuesParameterFormatString="original_{0}" 
        SelectMethod="GetSiteFeedbackItems" TypeName="Blazing.WebFacade.PageController" 
        UpdateMethod="UpdateFeedbackItem">
        <SelectParameters>
            <asp:SessionParameter Name="siteId" SessionField="siteId" Type="Int32" />
        </SelectParameters>
    </asp:ObjectDataSource>
 
    <ajax:UpdateProgress runat="server" ID="update" DisplayAfter="50">
        <progresstemplate>
        <uc3:Loading ID="Loading1" runat="server" />
    </progresstemplate>
    </ajax:UpdateProgress>
</asp:Content>
